package org.magneato.dto;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class Result {
	private String name;
	private String title;
	private long date;


	public Result(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDate(String format) {
	
		if (format.isEmpty()) {
			format = "yyyy-MM-dd";
		}
		final DateFormat dateFormat = new SimpleDateFormat(format);

		return dateFormat.format(date);
	}

	public void setDate(String date) {
		this.date = Long.parseLong(date)*1000;
	}

}
